from surprise import Dataset, Reader
print("导入成功！")
import pandas as pd

# 加载数据
ratings = pd.read_csv('u.data', sep='\t', names=['user','item','rating','timestamp'])
reader = Reader(rating_scale=(1, 5))
data = Dataset.load_from_df(ratings[['user', 'item', 'rating']], reader)